package com.xtedu.examproject.factory;

import com.xtedu.examproject.service.BatchDataService;
import com.xtedu.examproject.service.ExamQuestionBatchService;
import jakarta.servlet.http.HttpServletRequest;

/*
 * Author: xzy
 * Date: 2025/10/15
 * Last Modified by: xzy
 * Last Modified date: 2025/10/15
 * Description: TODO - Add file description here
 */
public class BatchServiceFactory {
    public static BatchDataService getBatchDataService(HttpServletRequest req) {
        String servletPath = req.getServletPath();

        // 标准化路径（去除前导和尾随斜杠）
        String type = servletPath.replaceAll("^/|/$", "");

        switch (type) {
            case "examquestionmanage": {
                return new ExamQuestionBatchService();
            }
            default: {
                return null;
            }
        }
    }
}
